1. Field of the Invention
This invention relates. to a method for supporting USB input devices via BIOS and, in particular, to a method for the operating systems, which do not support USB keyboard and mouse input devices, to support existing USB keyboards and. mouse input devices under a PC structure without the keyboard controller (KBC).
2. Related Art
In general, when a computer starts, there are some management procedures in the booting process, namely, the basic input output system (BIOS), such as the power-on selftest (POST), low level hardware setting for the disk: drives, keyboard, and monitor. It also provides some service routines for the firmware in the computer to control hardware. Nowadays, BIOS is stored in electrically erasable programmable read only memory (EEPROM) or erasable programmable read only memory (EPROM) to allow the user to renew internal data, in a proper time.
Currently, the keyboard controller (KBC) in usual PC structure is in a super I/O chipset. When BIOS supports the USB keyboard and mouse input devices, the system has to rely on the KBC on the super I/O chipset. An I/O port with the address 60h is on the KBC. When 60h is input with data, hardware interrupt requests IRQ1 or IRQ12 will be created so as to call the service routines for IRQ1 and IRQ12. However, for the Free PC proposed under the consideration of increasing the efficiency and decreasing the price, a super I/O chipset with only about 8 MHz industrial standard architect (ISA) is taken off and replaced by a USB controller with a 33 MHz peripheral component interface (PCI) structure as the KBC. Therefore, it does not only lower the cost, but also increases the efficiency from 8 MHz to 33 MHz, a factor of more than 4. At this moment, one has to use USB keyboards and mice to, replace conventional PC PS/2 keyboards and mice. The current BIOS would not be able to support them under the operating system because there is no address 60h on the KBC to send out IRQ1 and IRQ12.
In addition, if one wants to directly use USB keyboard and mouse service routines in BIOS to support USB keyboard and mouse, a great portion of the BIOS code has to be revised. This may cause some potential problems in BIOS and it does not support all operating systems, such as Windows NT 4.0. Thus, the problem that needs to be solved is: how BIOS supports USB keyboard and mouse input devices without the super I/O controller in the computer.
A main object of the instant invention is to provide a method for supporting USB input devices via BIOS when there is no keyboard controller on the motherboard. This method is especially applied to the operating systems that do not support USB keyboard-and mouse input devices and to the motherboards that do not have keyboard controller. These systems can use available USB keyboard and mouse input devices to achieve the object of backward compatibility. This method supports usual chipsets on the market with some modification on the firmware only.
The method for supporting USB input devices via BIOS disclosed in this specification allows the motherboards that do not have keyboard controller to use USB keyboard and mouse input devices. The method comprises the steps of:
setting the USB interrupt as the system management interrupt (SMI) while POST initializes the USB controller, and creating SMI from the I/O of addresses 60h and 64h; 
creating system management interrupt when the user presses a USB keyboard or moves a USB mouse and entering the USB service routine in system management memory (SMM);
getting input data from the USB keyboard and mouse input devices and judging the data source;
translating the input data into the legacy keyboard or mouse data according to the data source so that the service routines or drivers for IRQ1 and IRQ12 can correctly read legacy data;
creating a corresponding hardware interruption requests IRQ1 or IRQ12 by connecting general purpose output pins of a south bridge to an 8259 programmable interrupt controller chip on the south bridge;
creating a system management interrupt (SMI) signal and entering the USB service routine in the SMM when the service routine or driver of the keyboard or mouse gets the conventional keyboard or mouse data through the address 60h; 
de-asserting the general purpose output pins and thus IRQ1 or IRQ12; and storing the translated legacy data into an al register stack in the CPU state saved area in the SMM; and
determining whether there is any data pending, and going to the step of creating corresponding hardware interruption requests by connecting general purpose output pins if there is or ending if there is not.
By connecting two general purpose output pins of the south bridge to an 8259 programmable interrupt controller chip on the SB and modifying part of the internal USB service routine of the BIOS accordingly to simulate the generation of hardware interruption requests IRQ1 and IRQ12, the system can translate USB keyboard or mouse data into the legacy ones for the keyboard or mouse service routine or driver without affecting the operation of the operating system.
In this manner, one only needs to modify the firmware without increasing the cost on the hardware to support the usage of the keyboard and mouse when there is no KBC. This method is particularly useful in the operating system that does not support USB keyboard and mouse input devices.
Further scope of applicability of the present invention will become apparent from the detailed description given hereinafter. However, it should be understood that the detailed description and specific examples, while indicating preferred embodiments of the invention, are given bye way of illustration only, since various changes and modifications within the spirit and scope of the invention will become apparent to those skilled in the art from this detailed description.